<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box1 {
      width: 100px;
      height: 100px;
      margin: auto;
      background-color: chartreuse;
    }

    .box2 {
      width: 100px;
      height: 100px;
      margin: auto;
      background-color: rgb(224, 7, 152);
    }

    .box3 {
      width: 100px;
      height: 100px;
      margin: auto;
      background-color: rgb(0, 153, 255);
    }
  </style>
</head>

<body>
  <div id="app">
    <!-- v-bind:class  可以识别数组,对象的语法格式-->
    <div :class="css"></div>
    <div class="css[2]"></div>
    <!-- v-bind:style  会将行内样式映射成对象格式,其内的样式值支持运算 -->
    <div :style="{width:100+50+'px',height:50+50+'px',backgroundColor:color}"></div>
  </div>
  <script src="../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        css: ['box1', 'box2', { box3: true }],
        color: 'rgb(224, 7, 152)'
      },
      methods: {}
    })
  </script>
</body>

</html>